package api

import "github.com/dgrijalva/jwt-go"

type RegisterReq struct {
	Nickname   string `form:"nickname" json:"nickname"`
	Account    string `form:"username" json:"account"`
	Password   string `form:"password" json:"password"`
	RePassword string `form:"re_password" json:"re_password"`
	Email      string `form:"email" json:"email"`
}

type UserReq struct {
	Uid         int    `json:"uid" form:"uid"`
	Token       string `json:"token,omitempty" form:"token"`
	Account     string `json:"username,omitempty" form:"username"`
	Nickname    string `json:"nickname" form:"nickname"`
	Email       string `json:"email,omitempty" form:"email"`
	Phone       string `json:"phone,omitempty" form:"phone"`
	Avatar      string `json:"avatar" form:"avatar"`
	Description string `json:"intro,omitempty" form:"intro"`
}

type WechatBindReq struct {
	Username   string `form:"username" json:"username" binding:"required"`
	Password   string `form:"password" json:"password" binding:"required"`
	RePassword string `form:"re_password" json:"re_password"`
	Nickname   string `form:"nickname" json:"nickname"`
	Email      string `form:"email" json:"email"`
	Sess       string `form:"sess" json:"sess" binding:"required"`
}

type WechatReq struct {
	UserInfo string `form:"userInfo" json:"userInfo" binding:"required"`
	Code     string `form:"code" json:"code" binding:"required"`
}

type UserMoreInfo struct {
	MemberId              int `json:"uid"`
	SignedAt              int `json:"signed_at"` //会员签到时间
	CreatedAt             int `json:"created_at"`
	TotalSign             int `json:"total_sign"`
	TotalContinuousSign   int `json:"total_continuous_sign"`
	HistoryContinuousSign int `json:"history_continuous_sign"`
	TodayReading          int `json:"today_reading"`
	MonthReading          int `json:"month_reading"`
	TotalReading          int `json:"total_reading"`
}

// 这是受token保护的 信息
type JwtClaims struct {
	MemberId 	int
	Username    string
	NickName    string
	BufferTime  int64
	jwt.StandardClaims
}
